<?php
/**
 * shipping_agent SoapServer.
 *
 * @package shipping_agent
 * @copyright Copyright 2009 Structured Solutions
 * @license http://www.codeplex.com/ShippingAgent/license Microsoft Public License (Ms-PL)
 * @version 3.4
 */

// Turn off wsdl caching while making changes to the definition or implementation.
ini_set("soap.wsdl_cache_enabled", "1");

if (isset($HTTP_RAW_POST_DATA))
	$request = $HTTP_RAW_POST_DATA;
else 
	$request = file_get_contents("php://input");
	
if ($request == "" && !isset($_GET["wsdl"]) && !isset($_GET["WSDL"]))
{
	echo "This Shipping Agent for Zen Cart implements contract version " . shippingagent_impl::WSDL_VERSION . ".";
}
else 
{
	require("shippingagent_impl.php");
		
	$server = new SoapServer("shippingagent.wsdl");
	$server->setClass("shippingagent_impl");
	$server->handle($request);
}
?>